// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import StartUp from "../../../lib/StartUp";
import { selfCls } from "../../../lib/common/Decorator";
import { Manager } from "../../../lib/common/Manager";
import GameObject from "../../../lib/object/GameObject";
import DRole from "../../cache/DRole";
import GORole from "../role/GORole";

const {ccclass, property} = cc._decorator;

@selfCls
export default class RoleManager extends Manager {
    private _role:GORole;
    get parentRoot():cc.Node {
        return StartUp.instance.gameRoot;
    }

    public async do() {
        return new Promise<void>((resolve, reject)=>{
            resolve();
        })
    }

    createRole() {
        let go = new cc.Node();
        this._role = go.addComponent(GORole);
        this._role.init()
        this.node.addChild(go);
        
    }

}
